<%@ attribute name="session" required="true" type="net.muchine.web.front.session.UserSession" %>
<%@ attribute name="context" required="true" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<div id="top-menu">
	<c:choose>
    	<c:when test="${session.firstName == null}">
	    	<div id="account">
	    		<ul>
		      		<li><a href="${context}/account/login" class="login">Sign in</a></li>
		      		<li><a href="${context}/account/register" class="register">Register</a></li>
	      		</ul>
	      	</div>
      	</c:when>
      	<c:otherwise>
	       	<div id="account">
	      		<ul>
	        		<li><a href="${context}/my/account" class="my-account">My account</a></li>
					<li><a href="${context}/account/logout" class="logout">Sign out</a></li>
				</ul>
			</div>
	   		<div id="loggedas">Logged in as <a href="/users/${session.seq}">${session.firstName}</a></div>
       	</c:otherwise>
	</c:choose>

    <ul>
    	<li><a href="${context}" class="home">Home</a></li>
    	<c:if test="${session.firstName != null}">
    		<li><a href="${context}/my/page" class="my-page">My page</a></li>	
    	</c:if>
		<li><a href="${context}/projects" class="projects">Projects</a></li>
		<c:if test="${session.admin}">
			<li><a href="${context}/admin" class="administration">Administration</a></li>
		</c:if>
		<li><a href="http://www.redmine.org/guide" class="help">Help</a></li>
	</ul>
</div>

<div id="header">
    <div id="quick-search">
        <form accept-charset="UTF-8" action="${Context}/search" method="get">
        	<div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /></div>
	        <label for='q'>
	          <a href="${context}/search" accesskey="4">Search</a>:
	        </label>
	        <input accesskey="f" class="small" id="q" name="q" size="20" type="text" />
		</form>        
    </div>
    <h1>Redmine</h1>
</div>